package com.example.s06.config;

import com.example.s06.entity.Apple;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppleConfig {
    @Bean(initMethod = "initApple",destroyMethod = "destroyApple")
    //@Bean的作用是单实例模式
    public Apple apple(){
        Apple apple=new Apple();
        return apple;
    }
}
